package cn.biplam.back.services.log;

import cn.biplam.common.wrapper.ErrorMessage;

/**
 * 输出日志信息到数据库
 * @author 	WangSong 2009-3-11 下午03:47:01
 * @version 1.0
 */
public class LogDatabase implements Runnable {
	
	private String sMessage;
	
	/**
	 * 构造方法
	 * @param sMessage
	 * @param mErrorMessage
	 */
	public LogDatabase(String sMessage){
		this.sMessage = sMessage;
	}
	
	/**
	 * 写日志到数据库
	 * @throws ErrorMessage 
	 */
	private void write() {
		
		LogData mLogData = new LogData();
		String sException = "";
		String sUserID = "";
		String sPageID = "";
		
		mLogData.set(-1, 
				sUserID, 
				sPageID,
				this.sMessage,
				sException, 
				-1);

		mLogData.insert();
		
	}

	/**
	 * 实现Runnablerun方法
	 * @throws ErrorMessage 
	 */
	public void run() {

		this.write();
		
	} 
}
